package com.ytktt.study.week9.task3.rpcfx.properties;

import com.ytktt.study.week9.task3.rpcfx.enums.RegistryType;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 注册中心相关配置
 *
 * @author ytk
 */
@Getter
@Setter
@ConfigurationProperties(prefix = RegistryProperties.PREFIX)
public class RegistryProperties {

    public static final String PREFIX = "rpcfx.registry";

    private String url;

    private RegistryType type = RegistryType.ZOOKEEPER;

    private RetryProperties retry = new RetryProperties();

    @Getter
    @Setter
    public static class RetryProperties {

        private int baseSleepTimeMs;

        private int times;
    }
}
